<!doctype html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,initial-scale=1.0,width=device-width"/>
	<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
	<title>win</title>
	<link rel="stylesheet" type="text/css" href="../../css/index.css" />
	<style>
		html, body {width:100%; height: 100%;}
		.title{font-size: 18px; font-weight: bold;color:#ffffff;}
		#menu .menu{font-size: 16px;font-weight: 400;line-height: 28px;}
		#content{ display: none; height: 300px; margin: auto; position: fixed; top: 0px; left: 0px; right: 0px; bottom: 0px; }
		#content .icon{ width: 160px; height: 160px; margin: 0 auto;}
		#content .icon img{ width: 100%;}
		#content .str{ text-align: center; line-height: 30px; margin-top: 15px;}
		#content .str b{ font-size: 18px; font-weight: bold; display: block;}
		#content .str span{ font-size: 14px; color: #666; display: block;}
		#content .fot{ text-align: center; margin-top: 15px;}
		#content .fot .button{ display: inline-block; padding: 6px 25px; border-radius:25px; border: 1px solid #555}
		#yq_icon {width: 22px;height: 22px;margin-left: 20px;}
	</style>
</head>
<body>
	<div id="app-header" style="background-color:#FF9502;">
		<div class="headbar">
	        <div class="toolbar">
				<div class="lf tool" tapmode="" onclick="backMenu(this);"><span class="back b"></span></div>
				<div class="title han_1"><span id="title" style="color:#ffffff;"></span></div>
				<div class="rt tool menu" id="menu" tapmode="" style="color:#ffffff;" onclick="menuClick(this);"></div>
	        </div>
		</div>
		<!--导航条-->
   </div>
   <div id="content">
   		<div class="icon"><img src="../../image/main/no_wifi.png"></div>
		<div class="str">
			<b>网络竟然崩溃了</b>
			<span>别紧张，试试看刷新页面</span>
		</div>
		<div class="fot">
			<span class="button" onclick="shuaxinPage();">刷新</span>
		</div>
   </div>

</body>

<script type="text/javascript" src="../../script/base.min.js"></script>
<script type="text/javascript">
	var Pdata = null;
	var _top = lanYun.setHeader('app-header');
	define(function (require, exports, module) {
	 	Pdata = pageParam;
		if(Pdata.title){
			$('#title').html(Pdata.title);
		}
		//生成按钮
		if(Pdata.menu) {
			$('#menu').html(Pdata.menu);
		}else{
			$('#menu').hide();
		}
		if(Pdata.win && Pdata.win=='none') {
			$('#header').hide();
			_top = 0;
		}
		if(Pdata.win && Pdata.win=='mini') {
			$('.toolbar').hide();
			_top = _top - 48;
		}
	    loadFrame = function(){
			var connectionType = api.connectionType;
			if(connectionType == "none") {
				api.execScript({name: 'root', script:'needWifiCallBack();'});
				setTimeout(function(){
					$('body').css('background-color','#fff');
					$('#content').show();
					lanYun.hideProgress();
				}, 500);
				return;
			}
			lanYun.hideProgress();
			//console.log(JSON.stringify(Pdata.frameParam));
			api.openFrame({
				name : Pdata.name,
				url : Pdata._url,
				pageParam : Pdata.frameParam,
				bounces : Pdata.xiala, // 弹动
				reload : false, //自动重载
				overScrollMode:'scrolls',
				vScrollBarEnabled : Pdata.Scroll, //滚动条
				softInputDismissMode:['tap','drag'],
				allowEdit:true,
				rect : {x : 0,y : _top ,w : 'auto',h : 'auto'}
		    });
		}
		//禁止返回
		if(Pdata.backlock){
			exit_app();
		}
		loadFrame();
		lanYun.rmStorage('onshow');
		api.addEventListener({name:'viewappear'}, function(ret, err){
			if(!Pdata.isload){
				Pdata.isload = true;
			}else{
				var pm = {event:lanYun.getStorage('onshow')};
				api.execScript({ frameName: Pdata.name, script: 'onShow('+JSON.stringify(pm)+');' });
			}
		});

	});
	function shuaxinPage(){
		lanYun.showProgress({type:2});
		loadFrame();
	}
	//退出APP提示
	function exit_app() {
		api.addEventListener({name:'keyback'}, function(ret, err) {
			return false;
		});
	}
	//页面关闭方法
	function backMenu(tis){
		if(!Pdata.backlock){
			api.closeWin();
		}
	}
	//右上角按钮点击
	function menuClick(tis){
		api.execScript({
			frameName:Pdata.name,
	        script: 'topMenuClick();'
        });
	}

</script>
</html>
